import { HttpOptions } from "../type/interface"

export const baseUrl = "https://www.zzgood.top:3006/dream"
export const http = (options:HttpOptions) =>{
	return new Promise((resolve,reject) =>{
		uni.request({
			url:baseUrl + options.url,
			method:options.method || "GET",
			data:options.data || {},
			success(res) {
				resolve(res.data)
			},
			fail(err) {
				reject(err)
			},
		})
	}) 
}

